<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script type="text/javascript">
			var num;
			console.log(num);
			console.log(typeof(num));
			num = 3.14444;
			console.log(num);
			console.log(typeof(num));
			num = 'love';
			console.log(num);
			console.log(typeof(num));
			num = false;
			console.log(num);
			console.log(typeof(num));
			/* 等号 */
			var v1 = 10;
			var v2 = '10';
			if (v1 == v2){/* 仅仅判断值是否一样 */
				console.log('v1 == v2');
			}
			if(v1 === v2){/* 判断值和类型 */
				console.log('v1 === v2');
			}
			/* 方法 */
			var str = "I Love Delicious Food";
			console.log(str.toLowerCase());
			console.log(str.toUpperCase());
			console.log(str.charAt(3));
			console.log(str.indexOf('v'));
			console.log(str.split(' ',4));
			/* if */
			if (0){
				console.log('0');
			}
			if (1){
				console.log('1');
			}
			if (!0){
				console.log('!0');
			}
			if (''){
				console.log('');
			}
			if ('abc'){
				console.log('abc');
			}
			/* 数组 */
			console.log('----------------------')
			var arr1 = new Array(4);
			console.log(arr1.length);
			var arr2 = new Array();/* 创建了一个空数组 */
			console.log(arr2.length);
			arr2[0] = 'abc';
			console.log(arr2);
			arr2[1] = 10;
			console.log(arr2);
			arr2[3] = 'true';
			console.log(arr2);/* 能一直变化长度，类似于ArrayList */
			var arr3 = new Array();
			arr3.push('abc');
			console.log(arr3);
			arr3.push(11);
			console.log(arr3);
			arr3.push('false');
			console.log(arr3);/* 不借助下标进行压入 */
			console.log(arr3.pop());
			console.log(arr3.pop());
			console.log(arr3.pop());
			/* 弹出，类似于栈 */
			console.log(arr3);/* 全部弹出，已空 */
			/* innerText innerHtml */
			console.log('-------------------');
			var divObj1 = document.getElementsByTagName('div');
			divObj1.innerHTML = '<span style = "color: red;">innerHTML</span>';
			var divObj2 = document.getElementsByTagName('div');
			divObj2.innerText = '<span style = "color:blue;">innerText</span>';
		</script>
	</head>
	<body>
		<div></div>
	</body>
</html>
